Skip to content

refine(otaproxy): cache_index: store pre-computed headers dict; read_file_once: skip fadvise for small files read#913

Merged
Bodong-Yang merged 8 commits intomainfrom
chore/otaproxy_optimization_s3
Apr 21, 2026
Merged

refine(otaproxy): cache_index: store pre-computed headers dict; read_file_once: skip fadvise for small files read#913
Bodong-Yang merged 8 commits intomainfrom
chore/otaproxy_optimization_s3

Conversation

@Bodong-Yang
Copy link
Copy Markdown
Member

@Bodong-Yang Bodong-Yang commented Apr 20, 2026

Description

Following #884 and #895, this PR applies another optimizations to the otaproxy:

  1. now the element of the in-memory cache, the CacheIndexEntry stores the pre-computed read-only header(as CIMultiDictProxy), directly ready for use, reducing two header builds per request to one.

  2. for small files handling path(read_file_once), skip two syscalls of fadvice, as small files grow the memory usage much slower, kernel can handle the cache evicts without much problem.

The above two optimizations further reduce processing time cost per-request, contributing to faster request handling.

Check list

@Bodong-Yang Bodong-Yang added refinement Improve the performance, code quality(like improving code structure/readability/error handling/robus backport: v3.13.x labels Apr 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 20, 2026

📊 OTA Update Performance Comparison Report

Generated: 2026-04-21T07:26:12.516614

⏱️ Execution Time

Phase Legacy (s) V1 (s)
Total Duration 26.1 25.7
Metadata Processing 3.0 2.0
Delta Calculation 10.0 9.0
Download 2.0 3.0
Apply Update 5.0 6.0
Post Update 0.0 0.0
Finalization 0.0 0.0

@Bodong-Yang Bodong-Yang self-assigned this Apr 21, 2026
@Bodong-Yang Bodong-Yang marked this pull request as ready for review April 21, 2026 06:42
@Bodong-Yang Bodong-Yang requested a review from a team as a code owner April 21, 2026 06:42
Copy link
Copy Markdown
Collaborator

@airkei airkei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, LGTM.

@Bodong-Yang Bodong-Yang enabled auto-merge (squash) April 21, 2026 07:24
@sonarqubecloud
Copy link
Copy Markdown

@Bodong-Yang Bodong-Yang merged commit fc861dd into main Apr 21, 2026
11 checks passed
@Bodong-Yang Bodong-Yang deleted the chore/otaproxy_optimization_s3 branch April 21, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport: v3.13.x refinement Improve the performance, code quality(like improving code structure/readability/error handling/robus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants